<template>
<!--  新增盘点-->
  <div class="app-container">
  <sn-card-with-title>
    <!-- 标题 -->
    <StockCheckCurrentTitle
      @saveCheckStock="saveCheckStock"
      slot="title"/>

    <div slot="content">
      <!-- 搜索导航栏-->
      <stock-check-find-bar
        input-placeholder="输入药品名称"/>

      <!-- 表格 -->
      <current-check-table
        ref="currentCheckTable"
        :table-data="currentCheckTableData"/>
    </div>
  </sn-card-with-title>
  </div>
</template>

<script>
import CurrentCheckTable from "./children/CurrentCheckTable";
import StockCheckCurrentTitle from "./children/StockCheckCurrentTitle";
import StockCheckFindBar from "./children/StockCheckFindBar";

import {queryCurrentCheckRecordDetail} from "@/api/drug_manage/drugManage";

export default {
  name: "AddStocktaking",
  data() {
    return {
      currentCheckTableData: []
    }
  },
  components: {
    CurrentCheckTable,
    StockCheckFindBar,
    StockCheckCurrentTitle
  },
  methods: {
    //保存盘点
    saveCheckStock() {

    },

    //根据id查询正在盘点的记录详情
    toLookCurrentDetail() {
      queryCurrentCheckRecordDetail(this.$route.params.id).then(res => {
        console.log(res);
        this.currentCheckTableData = res.data.drugsS;
      })
    }
  },
  created() {

    this.toLookCurrentDetail()
  }
}
</script>

<style scoped>

</style>
